import axios from "axios";

export const getContextData = ({tab}) => 
    axios
        .get('https://www.fastmock.site/mock/759aba4bef0b02794e330cccc1c88555/beers/match') 
        .then ( res => {
                let result=res.data;
                if(tab){
                    switch(tab) {
                        case "sports":
                            result=result.filter(item => item.type=="sports");
                            // console.log(result);
                            break;
                        case "dj":
                            result=result.filter(item => item.type=="dj");
                            // console.log(result);
                            break;
                        default:
                            break;
                    }
                }
                return result;
            }
        )

    
   

